package com.itheima.pinda.controller;

import com.itheima.pinda.DTO.truck.TruckLicenseDto;
import com.itheima.pinda.service.PdTruckLicenseService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Api(tags = "车辆行驶证管理")
@RestController
@RequestMapping(value = "/base/license")
public class PdTruckLicenseController {

    @Autowired
    private PdTruckLicenseService truckLicenseService;

    @ApiOperation(value = "车辆行驶证新增")
    @PostMapping(value = "/insert")
    public TruckLicenseDto licenseInsertAndUpdate(TruckLicenseDto truckLicenseDto){

       return truckLicenseService.licenseInsertAndUpdate(truckLicenseDto);
    }

    @ApiOperation(value = "根据id查询")
    @GetMapping(value = "/id")
    public TruckLicenseDto selectById(@RequestParam("id") String id){

        return truckLicenseService.selectById(id);
    }
}
